# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=rinutils
pkgver=0.10.0
pkgrel=0
pkgdesc="C11 / gnu11 utilities C library"
url="https://www.shlomifish.org/open-source/projects/"
arch="noarch"
license="MIT"
makedepends="
	cmake
	cmocka-dev
	perl
	"
checkdepends="
	perl-dev
	perl-env-path
	perl-inline
	perl-inline-c
	perl-parse-recdescent
	perl-path-tiny
	perl-string-shellquote
	perl-test-differences
	perl-utils
	"
subpackages="$pkgname-dev"
source="https://github.com/shlomif/rinutils/releases/download/$pkgver/rinutils-$pkgver.tar.xz"
options="!check" # Requires unavailable perl modules Test::TrainlingSpace module

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
d3780b34b4eda4658f65cf7555553430441fcd45fb2d4fdba22a8f48c0df09c6c0a4e9543262c797c0602e2f9bace2d3f41514ae202ee13183286c9fb1f38677  rinutils-0.10.0.tar.xz
"
